package com.serviceprovider.business.module.check.controller;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.utility.RequestConstants;
import com.serviceprovider.business.utility.SecurityContextUser;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class PrintCheckController {
    protected final Log logger = LogFactory.getLog(getClass());

    @InitBinder
    public void initBinder(WebDataBinder binder) {
        logger.debug("initBinder finished");
    }

    @ModelAttribute("isAdmin")
    public Boolean isAdmin() {
        return SecurityContextUser.isAdmin();
    }

    @RequestMapping(
        value  = RequestConstants.CheckRequests.PRINT_CHECKS,
        method = { RequestMethod.GET, RequestMethod.POST }
    )
    public ModelAndView printChecks() {
        return reprintChecks();
    }

    /*
     *  @RequestMapping(value = "/serviceprovider/check/print_check/print_new_checks.htm", method = {RequestMethod.GET, RequestMethod.POST})
     * public ModelAndView printNewChecks() {
     *    ModelAndView result = new ModelAndView("/serviceprovider/check/print_check/print_new_checks");
     *    return result;
     * }
     */
    @RequestMapping(
        value  = "/serviceprovider/check/print_check/check_printing_option.htm",
        method = { RequestMethod.GET, RequestMethod.POST }
    )
    public ModelAndView checkprintingOption() {
        ModelAndView result = new ModelAndView("/serviceprovider/check/print_check/check_printing_option");

        return result;
    }

    @RequestMapping(
        value  = RequestConstants.CheckRequests.REPRINT_CHECKS,
        method = { RequestMethod.GET, RequestMethod.POST }
    )
    public ModelAndView reprintChecks() {
        ModelAndView result = new ModelAndView(RequestConstants.CheckRequests.VIEW_REPRINT_CHECKS);

        return result;
    }

    @RequestMapping(
        value  = RequestConstants.CheckRequests.PREPRINTED_BLANK_CHECKS,
        method = { RequestMethod.GET, RequestMethod.POST }
    )
    public ModelAndView prePrintedBlankChecks() {
        ModelAndView result = new ModelAndView(RequestConstants.CheckRequests.VIEW_PREPRINTED_BLANK_CHECKS);

        return result;
    }
}



